/* 降水量评价 */
Ext.create('Ext.data.Store', {
    storeId: 'preEval_store1',
    fields: ['regNm', 'area', 'curPd', 'curP', 'lyP', 'lyRt', 'annP', 'annRt'],
    data: []
});

Ext.define('Admin.view.evaluation.preEval.PreEval', {
    extend: 'Ext.container.Container',
    xtype: 'preEval',
    requires: ['Admin.view.evaluation.preEval.PreEvalController'],
    controller: 'preEvalController',
    margin: 10,
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    // userCLs: 'big-100 small-100',
    height: 200,
    autoLoad: true,
    config: {
        type: '0'
    },
    items: [{
        height: 46,
        xtype: 'toolbar',
        layout: {
            type: 'hbox',
            align: 'stretch'
        },
        cls: 'shadow',
        margin: '0 0 10 0',
        border: 1,
        style: {
            borderColor: '#ccc',
            borderStyle: 'solid'
        },
        items: [{
            xtype: 'component',
            id: 'preEvalComboWrapper',
            maxWidth: 220,
            width: '15%'
        }, {
            xtype: 'component',
            width: '65%',
        }, {
            xtype: 'segmentedbutton',
            id: 'preEvalSwitchBtns',
            cls: 'x-box-item my-top-nav',
            docked: 'right',
            width: '20%',
            minWidth: 200,
            maxWidth: '20%',
            items: [{
                id: 'preEvalBtn1',
                text: '行政分区',
                pressed: true,
                listeners: {
                    "click": 'switchAdminRegion'
                }
            }, {
                id: 'preEvalBtn2',
                text: '水资源分区',
                listeners: {
                    "click": 'switchWaterRegion'
                }
            }]
        }]
    }, {
        height: 250,
        cls: 'shadow',
        margin: '0 0 10 0',
        listeners: {
            resize: 'buildChart'
        }
    }, {
        flex: 1,
        title: '降水量评价',
        xtype: 'grid',
        cls: 'shadow',
        style: 'border: 1px solid #ccc',
        reference: 'preEvalGrid',
        // autoScroll: true,
        loadMask: true,
        stripeRows: true,
        columnLines: true,
        forceFit: true, //表格自适应
        columns: [{
            text: '分区',
            dataIndex: 'regNm',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }, {
            text: '计算面积(平方公里)',
            dataIndex: 'area',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }, {
            text: '年降水量',
            align: 'center',
            style: 'background: #EEEEEE',
            columns: [{
                text: '(毫米)',
                dataIndex: 'curPd',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE'
            }, {
                text: '(亿m³)',
                dataIndex: 'curP',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE'
            }]
        }, {
            text: '上年降水量(亿m³)',
            dataIndex: 'lyP',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }, {
            text: '与上年比较(±%)',
            dataIndex: 'lyRt',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }, {
            text: '多年平均(毫米)',
            dataIndex: 'annP',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }, {
            text: '与多年平均值比较(±%)',
            dataIndex: 'annRt',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE'
        }],
        store: Ext.data.StoreManager.lookup('preEval_store1')
    }],
    listeners: {
        afterrender: 'initData'
    }
});